package com.itheima.dao;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liam
 * @description
 * @date 2020/3/4-22:12
 * @Version 1.0.0
 */
public interface UserDao {

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User findByUsername(@Param("username") String username);

    List<User> findByCondition(String queryString);

    List<Integer> findRoleIdsByUserId(@Param("id") Integer id);

    void setUserIdAndRoleIdsBatch(@Param("userId") Integer userId,@Param("roleIds") List<Integer> roleIds);

    void deleteAssociationByUserId(@Param("userId") Integer userId);
}
